package com.eastmoney.emis.edda.domain.valueobject;

/**
 * @description: Description
 * @projectName: EDDA-HSBC
 * @package: com.eastmoney.emis.edda.domain.valueobject
 * @author: 汪程程
 * @date: 2022/12/20 11:12 AM
 * @version: 1.0
 */
public enum ErrorMsg {

    MPP02003("银行账号错误", "Invalid debtor account number"),
    MPP08001("被该银行驳回", "Rejected by Other bank"),
    MPP02011("银行账号不存在","Debtor account not Found"),
    MPP01005("银行账号和个人证件不匹配", "Debtor Account Name / Debtor Private Identification not matched"),
    MPP01020("重复提交", "Repeat submission"),
    MPP01011("系统错误 ", "System error"),
    UNKNOWN("信息填写错误", "Incorrect information filling")
    ;

    private final String hansMsg;
    private final String enMsg;
    ErrorMsg(String hansMsg, String enMsg) {
        this.hansMsg = hansMsg;
        this.enMsg = enMsg;
    }

    public String getHansMsg() {
        return hansMsg;
    }

    public String getEnMsg() {
        return enMsg;
    }

    private static final ErrorMsg[] ERROR_MSG_ARR =  ErrorMsg.values();
    public static ErrorMsg parse(String errorCode) {
        for (ErrorMsg errorMsg : ERROR_MSG_ARR) {
            if(errorMsg.name().equals(errorCode)) {
                return errorMsg;
            }
        }
        return UNKNOWN;
    }
}
